class BlinkThresh:
    def __init__(self):
# 保存纵横比
        self.thresh_holds = []
# 初始化阈值
        self.avg_thresh = -1
        pass
    def get_thresh(self, EAR):
        self.thresh_holds.append(EAR)
        cnt = len(self.thresh_holds)
        if cnt == 10:
            self.avg_thresh = sum(self.thresh_holds)/cnt
            self.thresh_holds.clear()
        return self.avg_thresh